﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserTest.aspx.cs" Inherits="OnLineExam.Web.UserTest" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
	<title>在线考试界面</title>
	<link href="../jquery-easyui-1.2.5/themes/default/easyui.css" rel="stylesheet" type="text/css" />
	<link href="../jquery-easyui-1.2.5/themes/icon.css" rel="stylesheet" type="text/css" />
	<script src="../jquery-easyui-1.2.5/jquery-1.7.1.min.js" type="text/javascript"></script>
	<script src="../jquery-easyui-1.2.5/jquery.easyui.min.js" type="text/javascript"></script>
	<script src="../Scripts/jQuery.FillOptions.js" type="text/javascript"></script>
	<script src="../jquery-easyui-1.2.5/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>


	<link href="assets/layui/2.2.5/css/layui.css" rel="stylesheet" />

	<script type="text/javascript">
		$(document).ready(function () {
			//绑定beforeunload事件 
			$(window).bind('beforeunload', function () {
				return '此次考试作废？？确定离开此页面吗？';
			});
			$("#<% =this.imgBtnSubmit.ClientID %>").click(function () { $(window).unbind('beforeunload'); });



			//解除绑定 
			//$(window).unbind('beforeunload');
		});

		function Click() {
			if (event.button != 1) {
				alert('为了保证考试的顺利进行，请不要做其他非法操作；否则会影响成绩！');
			}
		}
       // document.onmousedown = Click;
	</script>
	<style>
		body {
			font-size: 18px;
		}

		input[type="radio"] {
			width: 30px;
			height: 30px;
		}

		input[type="checkbox"] {
			width: 30px;
			height: 30px;
		}
	</style>
</head>
<body>
   
	<script src="assets/timerHelper.js?"></script>
	<script type="text/javascript" language="javascript">
		var time = <%=examtime %>;

		var allowExamNum ='<%=_allowExamCount %>';
		timerHelper.setOnTimeRuning("#f_hh", "#f_mm", "#f_ss");
		timerHelper.setOnTimeEnd(function () {
			var btnSum = '<%=imgBtnSubmit.ClientID%>';



			document.getElementById(btnSum).click();

		}
		);
		if (allowExamNum > 0)
			timerHelper.start(time * 60);
	</script>
	<form id="form1" runat="server"><asp:HiddenField ID="hdScoreId" runat="server" />
		<div style="position: fixed; top: 0px; left: 0px; height: 70px;">
			<blockquote class="layui-elem-quote">
				欢迎您：<asp:Label ID="labUser" runat="server" Text=""></asp:Label>
				<span id="daojishi" style="color: Red">剩余<font id="f_hh"></font>小时<font id="f_mm"></font>分<font id="f_ss"></font>秒</span>次数:(<%=_allowExamCount %>)已考:(<%=_hasExamCount %>)倒计时结束自动提交
						<asp:TextBox ID="timeBox" runat="server" BackColor="White" BorderColor="White"
							BorderStyle="None" Visible="False"></asp:TextBox>
				<font color="#4D2600" size="5" style="font-family: 楷体_GB2312">
					<asp:Label ID="Label7" runat="server" Text="考试试题：" /><asp:Label ID="Label1" runat="server"
						Text="<<" /><asp:Label ID="lblPaperName" runat="server"></asp:Label><asp:Label ID="Label12"
							runat="server" Text=">>" /></font>
				<button type="button" id="btnSubmit" class="layui-btn layui-btn-primary">开始交卷</button>
			</blockquote>

		</div>

		<div style="margin-top: 60px;">
			<table cellspacing="0" style="font-size: 12px; font-family: Tahoma; border-collapse: collapse; width: 100%; height: 100%;"
				cellpadding="0" align="center" border="1">
				<tr>
					<td style="height: 4px;" colspan="3">&nbsp;</td>
				</tr>
				<tr style="background: url(../Images/lineS.jpg) repeat-x;">
					<td style="height: 25;" colspan="3"></td>
				</tr>
				<tr>
					<td align="center"></td>
				</tr>
				<tr>
					<td>
						<br />
						<asp:ScriptManager ID="ScriptManager1" runat="server">
						</asp:ScriptManager>
						<asp:Panel ID="Panel1" runat="server">
							<a style="font-family: 楷体_GB2312; font-size: 15px; font-weight: bold;">一.单选（每题<asp:Label ID="labSingle" runat="server" Text=""></asp:Label>分）
							</a>
							<br />

							<asp:Repeater runat="server" ID="singleRep">
								<ItemTemplate><hr class="layui-bg-blue">
									<a>&nbsp; <%# singeCount++ %>
                                .<%# SetHtml(  Eval("Title")) %><asp:HiddenField runat="server" Value='<%# Eval("ID") %>' ID="titleId" />
									</a>
									<div>
										&nbsp; &nbsp;&nbsp; &nbsp;A.<asp:RadioButton ID="rbA" GroupName="option" runat="server" Text='<%# SetHtml( Eval("AnswerA")) %>' />
										<br />
										&nbsp; &nbsp;&nbsp; &nbsp;B.<asp:RadioButton ID="rbB" GroupName="option" runat="server" Text='<%# SetHtml(Eval("AnswerB")) %>' />
										<br />
										&nbsp; &nbsp;&nbsp; &nbsp;C.<asp:RadioButton ID="rbC" GroupName="option" runat="server" Text='<%# SetHtml(Eval("AnswerC")) %>' />
										<br />
										&nbsp; &nbsp;&nbsp; &nbsp;D.<asp:RadioButton ID="rbD" GroupName="option" runat="server" Text='<%# SetHtml(Eval("AnswerD")) %>' />
									</div>
								</ItemTemplate>
							</asp:Repeater>
						</asp:Panel>

						<asp:Panel ID="Panel2" runat="server">
							<a style="font-family: 楷体_GB2312; font-size: 15px; font-weight: bold;">
								<br />
								二.多单选（每题<asp:Label ID="lbMulti" runat="server" Text=""></asp:Label>分）
							</a>
							<br />

							<asp:Repeater runat="server" ID="rpMulti">
								<ItemTemplate>
                                    <hr class="layui-bg-orange">
									<a>&nbsp;<%# singeCount++ %>.<%# SetHtml(  Eval("Title")) %><asp:HiddenField runat="server" Value='<%# Eval("ID") %>' ID="titleId" />
									</a>
									<div>
										&nbsp; &nbsp;&nbsp; &nbsp;A.<asp:CheckBox ID="CheckBox1" runat="server" Text='<%# SetHtml( Eval("AnswerA")) %>'></asp:CheckBox>
										<br />
										&nbsp; &nbsp;&nbsp; &nbsp;B.<asp:CheckBox ID="CheckBox2" runat="server" Text='<%# SetHtml( Eval("AnswerB")) %>'></asp:CheckBox>
										<br />
										&nbsp; &nbsp;&nbsp; &nbsp;C.<asp:CheckBox ID="CheckBox3" runat="server" Text='<%# SetHtml( Eval("AnswerC")) %>'></asp:CheckBox>
										<br />
										&nbsp; &nbsp;&nbsp; &nbsp;D.<asp:CheckBox ID="CheckBox4" runat="server" Text='<%# SetHtml( Eval("AnswerD")) %>'></asp:CheckBox>
										<br />
										&nbsp; &nbsp;&nbsp; &nbsp;E.<asp:CheckBox ID="CheckBox5" runat="server" Text='<%#SetHtml(  Eval("AnswerE")) %>'></asp:CheckBox>
										<br />
										&nbsp; &nbsp;&nbsp; &nbsp;F.<asp:CheckBox ID="CheckBox6" runat="server" Text='<%# SetHtml( Eval("AnswerF")) %>'></asp:CheckBox>
										<br />
										&nbsp; &nbsp;&nbsp; &nbsp;G.<asp:CheckBox ID="CheckBox7" runat="server" Text='<%#SetHtml(  Eval("AnswerG")) %>'></asp:CheckBox>
									</div>
								</ItemTemplate>
							</asp:Repeater>
						</asp:Panel>

						<asp:Panel ID="Panel3" runat="server">
							<a style="font-family: 楷体_GB2312; font-size: 15px; font-weight: bold;">
								<br />
								三.判断选（每题<asp:Label ID="lbJudge" runat="server" Text=""></asp:Label>分）
							</a>
							<br />
							<asp:Repeater runat="server" ID="rpJudge">
								<ItemTemplate>
									<a>&nbsp;<%# singeCount++ %>.<%# Eval("Title") %><asp:HiddenField runat="server" Value='<%# Eval("ID") %>' ID="titleId" />
									</a>
									<div>
										<%--<asp:Label ID="Label10" runat="server" Text='<%# Eval("Title","{0}") %>'>--%>
                                &nbsp; &nbsp;&nbsp; &nbsp;<asp:RadioButton ID="rbA" GroupName="option" runat="server" Text="正确" />
										<br />
										&nbsp; &nbsp;&nbsp; &nbsp;<asp:RadioButton ID="rbB" GroupName="option" runat="server" Text="错误" />
										<%--<asp:CheckBox ID="CheckBox5" runat="server" Text="正确"></asp:CheckBox>--%>
									</div>
								</ItemTemplate>
							</asp:Repeater>
						</asp:Panel>

						<asp:Panel ID="Panel4" runat="server">
							<a style="font-family: 楷体_GB2312; font-size: 15px; font-weight: bold;">
								<br />
								四.填空选（每题<asp:Label ID="lbFillBlank" runat="server" Text=""></asp:Label>分）
							</a>
							<br />
							<asp:Repeater runat="server" ID="rpFillBlank">
								<ItemTemplate>
									<a>&nbsp;<%# singeCount++ %>.<%# Eval("FrontTitle") %><asp:HiddenField runat="server" Value='<%# Eval("ID") %>' ID="titleId" />
									</a>
									<%--<div>
                                <asp:TextBox ID="TextBox1" runat="server" Width="1000px" Style="border-bottom: gray   1px   solid"
                                    BorderStyle="None"></asp:TextBox>
                                <asp:Label ID="Label15" runat="server" Text='<%# Eval("BackTitle") %>'>
                                </asp:Label>
                            </div>--%>
								</ItemTemplate>
							</asp:Repeater>
						</asp:Panel>

						<asp:Panel ID="Panel5" runat="server">
							<a style="font-family: 楷体_GB2312; font-size: 15px; font-weight: bold;">
								<br />
								五.问答选（每题<asp:Label ID="lbQuestion" runat="server" Text=""></asp:Label>分）
							</a>
							<br />
							<asp:Repeater runat="server" ID="rpQuestion">
								<ItemTemplate>
									<a>&nbsp;<%# singeCount++ %>.<%# Eval("Title") %><asp:HiddenField runat="server" Value='<%# Eval("ID") %>' ID="titleId" />
									</a>
									<div>
										<asp:TextBox ID="TextBox2" runat="server" Width="1000px" TextMode="MultiLine"></asp:TextBox>
									</div>
								</ItemTemplate>
							</asp:Repeater>
						</asp:Panel>
						<br />
						<br />
						<div align="center">
							<a href="#top">返回顶端</a> &nbsp; &nbsp;<asp:ImageButton ID="imgBtnSubmit" runat="server"
								ImageUrl="Images/Submit.GIF" OnClick="imgBtnSubmit_Click" align="center" />
							<asp:Label ID="lblMessage" runat="server" ForeColor="Red"></asp:Label>
							<asp:HiddenField ID="hfDepID" runat="server" />
							<asp:HiddenField ID="hfCourseID" runat="server" />
						</div>
					</td>
				</tr>
			</table>
		</div>
	</form>
	<script>
		var btnSubmit = document.getElementById("btnSubmit");
		btnSubmit.onclick = function () {
			var id = '<%=imgBtnSubmit.ClientID%>';
			document.getElementById(id).click();
		};

	</script>
	<script src="assets/layui/2.2.5/layui.all.js"></script>
</body>
</html>
